import type { RouteRecordRaw } from 'vue-router'
import { basicRouteMap } from './router-modules'

export default [
  {
    path: '/dashboard',
    redirect: '/dashboard/analysis',
    name: 'Dashboard',
    meta: {
      title: '仪表盘',
      icon: 'DashboardOutlined',
    },
    component: basicRouteMap.RouteView,
    children: [
      {
        path: '/dashboard/analysis',
        name: 'DashboardAnalysis',
        component: () => import('~/pages/dashboard/analysis/index.vue'),
        meta: {
          title: '监控与统计',
          affix: true,
        },
      },
    ],
  },
  {
    path: '/flow',
    redirect: '/flow/editor',
    name: 'Editor',
    meta: {
      title: '服务编排',
      icon: 'PlayCircleOutlined',
    },
    component: basicRouteMap.RouteView,
    children: [
      {
        path: '/flow/flow-list',
        name: 'FlowList',
        component: () => import('~/pages/flow/flow-list/index.vue'),
        meta: {
          title: '流程管理',
          keepAlive: true,
        },
      },
      {
        path: '/flow/editor',
        name: 'FlowEditor',
        component: () => import('~/pages/flow/editor/index.vue'),
        meta: {
          title: '流程编辑器',
          hideInMenu: true,
        },
      },
    ],
  },
  {
    path: '/account',
    redirect: '/account/settings',
    name: 'Account',
    meta: {
      title: '个人页',
      icon: 'UserOutlined',
      locale: 'menu.account',
    },
    component: basicRouteMap.RouteView,
    children: [
      {
        path: '/account/settings',
        name: 'AccountSettings',
        component: () => import('~/pages/account/settings.vue'),
        meta: {
          title: '个人设置',
          locale: 'menu.account.settings',
        },
      },
    ],
  },
] as RouteRecordRaw[]
